<div class="row">
    <div class="col-xs-12 col-sm-12 col-md-12 col-lg-4">
        <h1 class="page-title txt-color-blueDark"><i class="fa-fw fa fa-group"></i> {:W('Nav/navTop')}
        <span>
            <a class="btn btn-primary" href="#{$Think.config.SUB_PATH}index.php?m=admin&c={:CONTROLLER_NAME}&a=addData"><i class="fa fa-plus-circle "></i>&nbsp;&nbsp;添加</a>
        </span>
        </h1>
    </div>
</div>
<!-- widget grid -->
<section id="widget-grid" class="">

    <!-- row -->
    <div class="row">

        <!-- NEW WIDGET START -->
        <article class="col-xs-12 col-sm-12 col-md-12 col-lg-12">

            <!-- Widget ID (each widget will need unique ID)-->
            <div class="jarviswidget jarviswidget-color-blueDark" id="sales-globals-1" data-widget-editbutton="false" data-widget-deletebutton="false">
                <header>
                    <span class="widget-icon"> <i class="fa fa-table"></i> </span>
                    <h2>DATA STATISTICS</h2>
                </header>

                <!-- widget div-->
                <div>

                    <!-- widget edit box -->
                    <div class="jarviswidget-editbox">
                        <!-- This area used as dropdown edit box -->

                    </div>
                    <!-- end widget edit box -->

                    <!-- widget content -->
                    <div class="widget-body no-padding">

                        <div class="widget-body-toolbar">
                        </div>
                        <table id="datatable" class="table table-striped table-bordered smart-form table-responsive table-hover">
                            <thead>
                                <tr>
                                    <volist name='show_data' id="vo">
                                        <th class="text-center">{$vo.name}</th>
                                    </volist>
                                </tr>
                                <!--<tr class="second">
                                    <td><label class="input"><input type="text" value="昵称" class="search_init"></label></td>
                                    <td>&nbsp;</td>
                                    <td><label class="input"><input type="text" value="推广码" class="search_init"></label></td>

                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>

                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>

                                    <td><label class="input"><input type="text" value="状态" class="search_init"></label></td>
                                    <td>&nbsp;</td>
                                </tr>-->
                            </thead>
                            <tbody>

                            </tbody>
                        </table>


                    </div>
                    <!-- end widget content -->

                </div>
                <!-- end widget div -->

            </div>
            <!-- end widget -->

        </article>
        <!-- WIDGET END -->

    </div>

    <!-- end row -->

</section>
<!-- end widget grid -->
<!-- ui-dialog -->
<div id="dialog_simple" title="&nbsp;" >
    <h5 id='log_tip'>
    </h5>
</div>

<div id="dialog_simple2" title="&nbsp;" >
    <h5 id='log_tip2'>
    </h5>
    <div id="sign" class="row">
        <div class="col-sm-12">
            <fieldset class="demo-switcher-1">
                <div class="form-group">
                    <div class="col-md-6" id="sign_l">
                    </div>
                    <div class="col-md-6" id="sign_r">
                        <!-- <div class="checkbox">
                            <label>
                                <input type="checkbox">
                                1
                            </label>
                        </div> -->
                    </div>
                </div>
            </fieldset>
        </div>
    </div>
</div>

<div id="dialog_simple3" title="&nbsp;" >
    <h5 id='log_tip3'>
    </h5>
    <div class="row">
        <div class="col-sm-12">
            <fieldset>
                <div class="form-group">
                    <div class="col-md-10" id="pos_c">
                    </div>
                    
                </div>
            </fieldset>
        </div>
    </div>
</div>
<!-- <script src="js/plugin/datatables/jquery.dataTables-cust.min.js"></script>
<script src="js/plugin/datatables/ColReorder.min.js"></script>
<script src="js/plugin/datatables/FixedColumns.min.js"></script>
<script src="js/plugin/datatables/ColVis.min.js"></script>
<script src="js/plugin/datatables/ZeroClipboard.js"></script>
<script src="js/plugin/datatables/media/js/TableTools.min.js"></script>
<script src="js/plugin/datatables/DT_bootstrap.js"></script> -->
<script type="text/javascript">
    pageSetUp();

    var langage=
    {
        "sZeroRecords": "没有检索到数据",
        "sInfo": "当前数据为从第 _START_ 到第 _END_ 条数据；总共有 _TOTAL_ 条记录",
        "sInfoEmtpy": "没有数据",
        "sProcessing": "正在加载数据...",
        "oPaginate":
        {
            "sFirst": "首页",
            "sPrevious": "前一页",
            "sNext": "后一页",
            "sLast": "尾页"
        }
    };

    var sAjaxSource = "{:U(APP_CONTROLLE/APP_NAME,array('_a'=>'dataList'))}";
    var sAjaxSource_code = "{:U(APP_CONTROLLE/APP_NAME,array('_a'=>'updateData'))}";
    var sAjaxSource_del = "{:U(APP_CONTROLLE/APP_NAME,array('_a'=>'delData'))}";
    var aoColumns = {$json_data};

    loadScript('js/plugin/datatables/jquery.dataTables-cust.min.js',function()
    {
        loadScript('js/plugin/datatables/media/js/TableTools.min.js',function()
        {
            loadScript('js/plugin/datatables/DT_bootstrap.js',function()
            {
                loadScript('js/app/auto_index.js?v=4',function()
                {
                    initWeixinIndex(aoColumns);
                });
            });
        });
    });


    var id=''
    function dialog_del(param){
        $('#log_tip').html("是否删除此条信息");
        $('#dialog_simple').dialog('open');
        id = param;
        return false;
    }
    $('#dialog_simple').dialog({
        autoOpen : false,
        width : 300,
        resizable : false,
        modal : true,
        title : "",
        buttons : [{
            html : "<i class='fa fa-trash-o'></i>&nbsp; 删除",
            "class" : "btn btn-danger",
            click : function() {
                $(this).dialog("close");
                $.post(sAjaxSource_del,'id='+id, function (data) {
                        showhidetip(data.msg,2);
                },
                "json"
                );
                setTimeout(function(){
                    window.location.reload(true);
                }, 1000)
                return false;
            }
        }, {
            html : "<i class='fa fa-times'></i>&nbsp; 取消",
            "class" : "btn btn-default",
            click : function() {
                $(this).dialog("close");
            }
        }]
    });

    var id=''
    var sAjaxSource_sign = "{:U('sign/index',array('_a'=>'getSignByBid'))}";
    function add_book_tag(param){
        $('#log_tip2').html("已添加 | 所有书签");
        $('#dialog_simple2').dialog('open');
        id = param;
        $.post(sAjaxSource_sign,'id='+id, function (data) {
                // showhidetip(data.msg,2);
                $('#sign_l').html(data.content.left);
                $('#sign_r').html(data.content.rigth);

        },
        "json"
        );
        return false;
    }
    $('#dialog_simple2').dialog({
        autoOpen : false,
        width : 300,
        resizable : false,
        modal : true,
        title : "",
        buttons : [{
            html : "<i class='fa fa-trash-o'></i>&nbsp; 保存",
            "class" : "btn btn-danger",
            click : function() {
                var str=''
                $('.checkbox input').each(function(i) {
                    if($(this).prop('checked')){
                        // array.push($(this).val())
                        str +=$(this).val()+',';
                    }
                })
                var sAjaxSource_upsign = "{:U('sign/index',array('_a'=>'updateSign'))}";
                $.post(sAjaxSource_upsign,'id='+id+'&sign_name='+str, function (data) {
                        showhidetip(data.msg,2);
                },
                "json"
                );

                $(this).dialog("close");

                // setTimeout(function(){
                //     window.location.reload(true);
                // }, 1000)
                return false;
            }
        }, {
            html : "<i class='fa fa-times'></i>&nbsp; 取消",
            "class" : "btn btn-default",
            click : function() {
                $(this).dialog("close");
            }
        }]
    });

    var id=''
    var sAjaxSource_posi = "{:U('position/index',array('_a'=>'getPositionByBid'))}";
    function position(param){
        // alert(10)
        $('#log_tip3').html("位置");
        $('#dialog_simple3').dialog('open');
        id = param;
        $.post(sAjaxSource_posi,'id='+id, function (data) {
                // showhidetip(data.msg,2);
                $('#pos_c').html(data.content);
        },
        "json"
        );
        return false;
    }
    $('#dialog_simple3').dialog({
        autoOpen : false,
        width : 300,
        resizable : false,
        modal : true,
        title : "",
        buttons : [{
            html : "<i class='fa fa-trash-o'></i>&nbsp; 保存",
            "class" : "btn btn-danger",
            click : function() {
                var str=''
                $('.checkbox input').each(function(i) {
                    if($(this).prop('checked')){
                        // array.push($(this).val())
                        str +=$(this).val()+',';
                    }
                })
                var sAjaxSource_upsign = "{:U('position/index',array('_a'=>'updatePos'))}";
                $.post(sAjaxSource_upsign,'id='+id+'&pos_str='+str, function (data) {
                        showhidetip(data.msg,2);
                },
                "json"
                );

                $(this).dialog("close");

                // setTimeout(function(){
                //     window.location.reload(true);
                // }, 1000)
                return false;
            }
        }, {
            html : "<i class='fa fa-times'></i>&nbsp; 取消",
            "class" : "btn btn-default",
            click : function() {
                $(this).dialog("close");
            }
        }]
    });
</script>